// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#pragma once

#include "fastflow/framework/allocator_info.h"
#include "fastflow/framework/onnx_object.h"

#ifdef __cplusplus
extern "C" {
#endif
//inherented from ONNXObject
typedef struct FASTFLOWAllocatorInteface {
  struct ONNXObject parent;
  void*(FASTFLOW_API_STATUSCALL* Alloc)(void* this_, size_t size);
  void(FASTFLOW_API_STATUSCALL* Free)(void* this_, void* p);
  const struct FASTFLOWAllocatorInfo*(FASTFLOW_API_STATUSCALL* Info)(const void* this_);
} FASTFLOWAllocatorInteface;

typedef FASTFLOWAllocatorInteface* FASTFLOWAllocator;

FASTFLOW_API(void*, FASTFLOWAllocatorAlloc, _Inout_ FASTFLOWAllocator* ptr, size_t size);
FASTFLOW_API(void, FASTFLOWAllocatorFree, _Inout_ FASTFLOWAllocator* ptr, void* p);
FASTFLOW_API(const struct FASTFLOWAllocatorInfo*, FASTFLOWAllocatorGetInfo, _In_ const FASTFLOWAllocator* ptr);

#ifdef __cplusplus
}
#endif
